<style type="text/css">
a {
	cursor: pointer;
}
.permission {
	margin-top: 10px;
}
.permission .ckbox{
	display: inline-block;
	margin-right: 35px;
}
.user-type.form-group .btn-group, .is-admin.form-group .btn-group {
	margin-left: 10px;
}
.user-type .btn-group .dropdown-toggle, .is-admin .btn-group .dropdown-toggle {
	min-width: 160px;
	text-align: left;
}
</style>
<div class="pageheader">
	<h2>
		<i class="fa fa-users"></i>用户管理
	</h2>
	<div class="breadcrumb-wrapper">
		<span class="label">你所在的位置：</span>
		<ol class="breadcrumb">
			<li><a href="/index">ERP管理系统</a></li>
			<li>用户管理</li>
			<li class="active">添加用户</li>
		</ol>
	</div>
</div>
<div class="contentpanel">
    <div class="main">
    <form action="/auth/add" method="post" class="form-horizontal">
        <?php if ($this->msg):?>
        <div style="margin: 20px 216px;" class="form-group"><?php foreach ($this->msg as $v):?><span class="label label-warning"><?php echo $v;?></span><?php endforeach;?></div>
        <?php endif;?>  
        <div class="form-group form-inline">
            <label for="Username" class="col-sm-2 control-label">用户名：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="username" size="58">
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Truename" class="col-sm-2 control-label">真实姓名：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="truename" value=" " size="58"></input>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Email" class="col-sm-2 control-label">QA邮箱：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="email" value=" " size="58"></input>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Password" class="col-sm-2 control-label">密码：</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" name="password" value="" size="58"></input>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Confirm_password" class="col-sm-2 control-label">重复密码：</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" name="confirm_password" size="58"></input>
            </div>
        </div>
        <div class="form-group is-admin">
            <label class="col-sm-2 control-label">团队管理员：</label>
            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="type">请选择是否  </span></button>
                <input type="hidden" value="0" name="is_admin">
                <ul class="dropdown-menu">
                    <li><a data-id="1">是</a></li>
                    <li><a data-id="0">否</a></li>
               </ul>
            </div>
        </div>
        <div class="form-group user-type">
            <label class="col-sm-2 control-label">用户类型：</label>
            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="type">请选择团队 </span></button>
                <input type="hidden" value="0" name="user_type">
                <ul class="dropdown-menu">
                    <li><a data-id="1">管理团队</a></li>
                    <li><a data-id="2">运营团队</a></li>
                    <li><a data-id="3">技术团队</a></li>
                    <li><a data-id="4">仓储行政团队</a></li>
               </ul>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Is_admin" class="col-sm-2 control-label">权限：</label>
            <div class="col-sm-10">
	            <div class="permission">
	                <div class="ckbox ckbox-warning">
	                    <input id="checkboxStock" type="checkbox" checked="checked" value="1" name="permission[]">
	                    <label for="checkboxStock">库存管理</label>
	                </div>
	                <div class="ckbox ckbox-warning">
	                    <input id="checkboxLog" type="checkbox" checked="checked" value="2" name="permission[]">
	                    <label for="checkboxLog">日志管理</label>
	                </div>
	                <div class="ckbox ckbox-warning">
	                    <input id="checkboxCart" type="checkbox" checked="checked" value="3" name="permission[]">
	                    <label for="checkboxCart">销售管理</label>
	                </div>
	                <div class="ckbox ckbox-warning">
	                    <input id="checkboxCRM" type="checkbox" checked="checked" value="4" name="permission[]">
	                    <label for="checkboxCRM">客户管理</label>
	                </div>
	                <div class="ckbox ckbox-warning">
	                    <input id="checkboxOffice" type="checkbox" checked="checked" value="5" name="permission[]">
	                    <label for="checkboxOffice">办公管理</label>
	                </div>
	                <div class="ckbox ckbox-warning">
	                    <input id="checkboxUser" type="checkbox" checked="checked" value="6" name="permission[]">
	                    <label for="checkboxUser">用户管理</label>
	                </div>
	            </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </div>
    </form>
    </div>
</div>
<script type="text/javascript">
$(document).ready(function(){
    $(".user-type li a").click(function(){
        $(".user-type .type").text($(this).text());
        $(".user-type input").val($(this).data('id'));
    });
    $(".is-admin li a").click(function(){
        $(".is-admin .type").text($(this).text());
        $(".is-admin input").val($(this).data('id'));
    });
})
</script>